package IO;

import java.io.*;

public class Fileinputstram {
    public static void main(String[] args) throws IOException {
        InputStream in = new FileInputStream("day10-file_io/src/File.txt");
//        int b;
//        while((b=in.read())!=-1){
//            System.out.print((char)b);
//        }
//        System.out.println();

        byte[] bytes=new byte[1024];
        int len;
        while((len=in.read(bytes))!=-1){
            System.out.println(len);
            System.out.print(new String(bytes,0,len));
        }
        in.close();
    }
}
